package cn.itsource.org.mapper;

import cn.itsource.basic.domain.AjaxResult;
import cn.itsource.basic.mysuper.MyBaseMapper;

import cn.itsource.org.domain.Shop;
import cn.itsource.org.domain.User;
import tk.mybatis.mapper.entity.Example;

public interface UserMapper extends MyBaseMapper<User> {
    //一定要重写这个方法
    default  Class<User> getTClass(){
        return User.class;
    }


    default User login(User user){
        Example example = new Example(getTClass());
        example.createCriteria()
                .andEqualTo("username",user.getUsername())
                .orEqualTo("email",user.getUsername())
                .orEqualTo("phone",user.getUsername());
        return this.selectOneByExample(example);
    }
}
